﻿using System.Collections;
using com.yoozoo.gta.Extension.UGUI.ScreenOrientationEx;
using FlowCanvas;
using FlowCanvas.Nodes;
using NodeCanvas.Framework;
using ParadoxNotion.Design;
using UnityEngine;

namespace Yoozoo.Gameplay.Liberty.Nodes
{
    [Category("Ggame")]
    public class SwitchIsPortrait : FlowControlNode
    {

        protected override void RegisterPorts()
        {
            var casePortrait = AddFlowOutput("Portrait");
            var caseLandscape = AddFlowOutput("Landscape");
            AddFlowInput("In", (f) =>
            {
                bool isTrue = ScreenOrientManager.GetInstance().GetScreenOrientationIsPortrait();
                if (isTrue)
                {
                    f.Call(casePortrait);
                }
                else
                {
                    f.Call(caseLandscape);
                }
            });

        }
    }
}